package com.boe.server.register.controller;

import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("user")
public class UserController {

    @RequestMapping("details")
    public String details() {

        return "user details";
    }

    @GetMapping("roles")
    public Object roles() {
        return SecurityContextHolder.getContext().getAuthentication().getAuthorities();
    }
}
